package com.wiscamp.ninechapters.problems.infrastructure.mappers.assessments;

import com.wiscamp.ninechapters.problems.infrastructure.po.assessments.UserAssessmentPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;

@Repository
public interface UserAssessmentMapper extends JpaRepository<UserAssessmentPO, Long>, JpaSpecificationExecutor<UserAssessmentPO> {
    @Query(value = "select e from UserAssessmentPO e where e.setId = :setId and e.userId = :userId")
    Collection<UserAssessmentPO> findUserAssessments(long setId, long userId);

}